import axios from '../../axios'

/* 
 * 菜单管理模块
 */

 // 添加
export const addMenu = (data) => {
    return axios({
        url: '/kysj/user/menu/addMenu',
        method: 'put',
        data
    })
}
 // 统计
export const count = () => {
    return axios({
        url: '/kysj/user/menu/count',
        method: 'get',
    })
}
// 删除
export const deleteMenu = (menuId) => {
    return axios({
        url: '/kysj/user/menu/deleteMenu?menuId=' + menuId,
        method: 'delete',
    })
}
// 查询所有菜单
export const findAll = () => {
    return axios({
        url: '/kysj/user/menu/findAll',
        method: 'get',
    })
}
// 分页查询菜单树
export const findByPage = (page,pageSize) => {
    return axios({
        url: '/kysj/user/menu/findByPage/'+page+'/'+pageSize+'/',
        method: 'get',
    })
}
// 查询用户可以加载哪些菜单
export const findUserMenu = (userId) => {
    return axios({
        url: '/kysj/user/menu/findUserMenu?userId='+userId,
        method: 'get',
    })
}
// 更新
export const updateMenu = (data) => {
    return axios({
        url: '/kysj/user/menu/updateMenu',
        method: 'post',
        data
    })
}

